package pratice;
/**
 *
 * 功能：从键盘输入一些参数
 */

import java.util.Scanner;

public class X2Input {

    int SampleNumber() {
        Scanner sc= new Scanner(System.in);
        System.out.println("请输入样本容量：");
        int SampleNumber =sc.nextInt();

        return SampleNumber;

    }
    float input() {
    int SampleNumber=SampleNumber();

        Scanner sc= new Scanner(System.in);

        System.out.println("请输入总体方差：");
        float PopulationVariance =sc.nextFloat();
        //   System.out.println("总体方差为" +PopulationVariance);

        System.out.println("请输入样本方差：");
        float SampleVariance =sc.nextFloat();
        //   System.out.println("样本方差为"+SampleVariance);

        float value=(SampleNumber-1)*SampleVariance/PopulationVariance;
        //   System.out.println("计算结果为"+value);
        return value;
    }
}
